package com.hx.vending.controller;

import com.hx.vending.bean.Rise;
import com.hx.vending.service.IRiseService;
import com.hx.vending.util.Msg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * Created by Administrator on 2018/11/28.
 * 售货机层
 */
@Controller
@RequestMapping("/rise")
public class RiseController {


    @Autowired
    private IRiseService iRiseService;


    /**
     * 添加或修改层信息
     * @param rise
     * @return
     */
    @PostMapping("/updateOrInsertRise")
    @ResponseBody
    public Msg updateOrInsertRise(@RequestBody Rise rise){

        return this.iRiseService.updateOrInsertRise(rise);
    }


    /**
     * 删除层
     * @param riseId
     * @return
     */
    @DeleteMapping("/deleteRise")
    @ResponseBody
    public Msg deleteRise(Integer modelId, Integer riseId){

        return this.iRiseService.deleteRise(modelId, riseId);
    }

}
